Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto-generated Wiki Page for Commands #510

Merged
merged 19 commits into from
Feb 9, 2024
Merged

Conversation

KuroganeToyama
Copy link
Contributor

Summary of Changes

  • Added script to auto-generate wiki markdown page for commands by grabbing info in implementation files
  • Wiki gets updated every time CodeyBot is relaunched
  • Updated wiki link of help command

Related Issues

Notes

  • Open to any suggestions for better wiki design

Copy link
Contributor

@probro27 probro27 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@KuroganeToyama Thanks for working on this, really appreciate you clarifying everything with me.
Couple of functionality issues:

  • So the script doesn't really work (?) as in when I added a new command (you can reproduce it by copying info.ts files from command and commandDetails to a new file and renaming everything) and it didn't update the wiki when I re-started the bot
  • Also if you change the description somewhere, and run the bot, it doesn't change the wiki.
  • Also try and support the case where you have deleted the wiki (think it should be supported by writeFile) but not sure why it wasn't working.

I am running the bot using yarn image:build && yarn clean && yarn start as well as just yarn start, but didn't see a change. The function is running since I tried adding a log and it worked. I think the issue is with the wikiPath since you are using a relative path
My log using path.join(__dirname, wikiPath): 024-02-07 05:36:28 - info - Updating COMMAND-WIKI.md at /usr/app/dist/src/utils/docs/COMMAND-WIKI.md

This suggests that the wiki being updated is inside the docker container (maybe it worked for you since you were running it without docker). I would suggest you try and find a way to get the repository location (I am not sure myself how and am looking into it).

src/utils/updateWiki.ts Outdated Show resolved Hide resolved
src/utils/updateWiki.ts Outdated Show resolved Hide resolved
src/utils/updateWiki.ts Show resolved Hide resolved
src/utils/updateWiki.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@probro27 probro27 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@KuroganeToyama Great job with the changes. Couple of nitpicks to just wrap this up!

src/events/ready.ts Outdated Show resolved Hide resolved
docs/COMMAND-WIKI.md Outdated Show resolved Hide resolved
Copy link
Contributor

@probro27 probro27 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@KuroganeToyama LGTM! I'll just let @Fan-Yang-284 check this as well and then we can merge it in!

Copy link
Contributor

@Fan-Yang-284 Fan-Yang-284 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome work on this! This is actually really nice, I just have a few small suggestions to maybe consider.

src/utils/updateWiki.ts Outdated Show resolved Hide resolved
src/utils/updateWiki.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@Fan-Yang-284 Fan-Yang-284 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks - LGTM!

@KuroganeToyama KuroganeToyama merged commit 7cd227f into main Feb 9, 2024
2 checks passed
@KuroganeToyama KuroganeToyama deleted the issue-#186-help-command branch February 9, 2024 21:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE] sapphire .help
3 participants